package lesson.myinput;

import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;

public class MyInputDemo6 {
    public static void main(String[] args) throws UnsupportedEncodingException {
        String s = "黑马程序员";
        byte [] bytes = s.getBytes();
        System.out.println(Arrays.toString(bytes));

        byte [] bytes1 = s.getBytes("GBK");
        System.out.println(Arrays.toString(bytes1));

        System.out.println("=======================================");

        byte [] bytes2 = {-23, -69, -111, -23, -87, -84, -25, -88, -117, -27, -70, -113, -27, -111, -104};
        byte [] bytes3 = {-70,-38,-62,-19,-77,-52,-48,-14,-44,-79};

        String s1 = new String(bytes2);
        System.out.println(s1);

        String s2 = new String(bytes3,"gbk");
        System.out.println(s2);

    }
}
